package com.isorf.mapper;

import com.isorf.pojo.inventory;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface inventorymapper {

    /**
     * 批量添加库存信息
     * @param shoeId 鞋子ID
     * @param inventoryList 库存列表
     * @return 影响的行数
     */
    int addInventoryList(@Param("shoeId") Integer shoeId, @Param("inventoryList") List<inventory> inventoryList);

    @Delete({
            "<script>",
            "DELETE FROM inventorylist WHERE shoe_id IN",
            "<foreach item='id' collection='ids' open='(' separator=',' close=')'>",
            "#{id}",
            "</foreach>",
            "</script>"
    })
    void deleteByShoeIds(@Param("ids") List<Integer> ids);

}
